package com.example.petproject.mapper;

import com.example.petproject.entity.DetailCategories;
import com.example.petproject.entity.DetailSkuList;
import com.example.petproject.entity.DetailSpu;
import com.example.petproject.entity.dto.ProductSearchDTO;
import com.example.petproject.entity.model.PmsSpu;
import com.example.petproject.entity.vo.ProductSearchVO;
import com.github.pagehelper.Page;

import java.util.List;

public interface PmsSpuMapper {
    int deleteByPrimaryKey(Long id);

    int insertSelective(PmsSpu record);

    PmsSpu selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(PmsSpu record);

    /**
     * 分页条件查询
     * @param productSearchDTO
     * @return
     */
    Page<ProductSearchVO> selectProductByParam(ProductSearchDTO productSearchDTO);

    /**
     * 查询商品信息
     * @param spuId 商品Id
     * @return Spu
     */
    DetailSpu selectBySpuId(Integer spuId);

    /**
     *  查询商品分类信息
     * @return Categories
     */
    List<DetailCategories> selectCategories();

    /**
     *  查询商品的sku信息
     * @param spuId spuId
     * @return SkuList
     */
    List<DetailSkuList> selectSkuListBySpuId(Integer spuId);

}